Skip to content

fix(pipeline): say what actually failed, and guard against dead modules - #281

Merged
ANonABento merged 1 commit into
mainfrom
trigger-error-detail
Aug 23, 2026
Merged

fix(pipeline): say what actually failed, and guard against dead modules#281
ANonABento merged 1 commit into
mainfrom
trigger-error-detail

Conversation

@ANonABento

Copy link
Copy Markdown
Owner

Two things — the second found while fixing the first, and it's the bigger one.

1. Trigger failures now carry their reason to the card

Every failing card read "Execution failed" while the real reason existed only in a log:

[create_pr] Failed for task …: git push --force failed:
fatal: 'origin' does not appear to be a git repository

create_pr, run_script and the managed-turn completion all called mark_complete with no detail, so the generic fallback was what the user saw. Each now passes one:

  • create_pr keeps the error it was previously only logging and emitting as an ephemeral Tauri event — which helps only if a panel happens to be mounted.
  • run_script names the step: Step 'lint' failed: exited 1, instead of leaving you to guess which of six steps it was.
  • managed turn reports the CLI and exit code.

failure_message() applies the generic string only when there genuinely is no reason, and treats blank/whitespace-only detail as absent — otherwise a card could store an empty error that renders as no error.

Worth noting: that reason is visible at all only because #276 installed a logger. Before this session it was discarded outright.

2. ~1,165 lines of pipeline Rust are never compiled

While fixing the above I edited pipeline/completion.rs, added a test, and watched it not run.

completion.rs, engine.rs, events.rs, exit.rs and test_utils.rs have no mod declaration anywhere. Commit 234a992 "Split pipeline/mod.rs" created them and never wired them up — the split silently never took effect. mod.rs kept the live implementation, and duplicate copies of decide_completion and mark_complete_with_error have sat beside it ever since.

The trap is that it all reads like production code: cargo build passes, clippy passes, and editing it changes nothing at runtime. The real fix went into pipeline/mod.rs.

scripts/check-rust-modules.js now fails CI on any .rs file no mod declaration reaches:

Rust files that no `mod` declaration pulls in — these are never compiled:
  - src-tauri/src/pipeline/probe_dead.rs  (3 lines, never compiled)

The five known files sit in a documented KNOWN_DEAD allowlist so new files are still guarded. The check also fails if that list names a file that no longer exists, so it shrinks rather than rots. Directories holding no Rust (db/migrations/, which is .sql read at runtime) are skipped.

Decision needed from you, not me: delete the five, or finish the split. Declaring them as-is will not build — the symbols are duplicated. Filed as roadmap 2b.

Checks

cargo clippy -D warnings · cargo test --lib 570 (+1) · tsc · eslint · test:ipc · test:type-scale · test:rust-modules (new) · vitest 444.

Two things, the second found while fixing the first.

Trigger failures now carry their reason to the card.

Every failing card read "Execution failed" while the real reason existed
only in a log — `git push --force failed: fatal: 'origin' does not appear to
be a git repository`, for instance. `create_pr`, `run_script` and the
managed-turn completion all called `mark_complete` with no detail, so the
generic fallback was what the user saw. Each now passes one:

- create_pr keeps the error it was previously only logging and emitting as
  an ephemeral Tauri event (which helps only if a panel is mounted).
- run_script names the step: "Step 'lint' failed: exited 1", rather than
  leaving you to guess which of six steps it was.
- the managed turn reports the CLI and exit code.

`failure_message()` applies the generic string only when there genuinely is
no reason, and treats blank or whitespace-only detail as absent — otherwise
a card could store an empty error that renders as no error at all.

~1,165 lines of pipeline Rust are never compiled.

While fixing the above I edited `pipeline/completion.rs`, added a test, and
watched it not run. `completion.rs`, `engine.rs`, `events.rs`, `exit.rs` and
`test_utils.rs` have no `mod` declaration anywhere: commit 234a992 "Split
pipeline/mod.rs" created them and never wired them up, so the split silently
never took effect. `mod.rs` kept the live implementation, and duplicate
copies of `decide_completion` and `mark_complete_with_error` have sat beside
it ever since.

The trap is that it all reads like production code. `cargo build` passes,
`clippy` passes, the file looks live, and editing it changes nothing at
runtime. The real fix went into `pipeline/mod.rs`.

`scripts/check-rust-modules.js` now fails CI on any `.rs` file no `mod`
declaration reaches, with the five known ones in a documented `KNOWN_DEAD`
allowlist so new files are still guarded. It also fails if that list names a
file that no longer exists, so it shrinks rather than rots. Directories
holding no Rust (`db/migrations/`, which is .sql read at runtime) are
skipped.

Deleting the five or finishing the split is a call for whoever owns that
refactor — declaring them as-is will not build, since the symbols are
duplicated. Filed on the roadmap.
@ANonABento
ANonABento merged commit 5733401 into main Aug 23, 2026
3 checks passed
@ANonABento
ANonABento deleted the trigger-error-detail branch August 23, 2026 03:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant